fix(determinism): asteroid roll keys on the saved world seed; stable audio hashes - #722
Merged
Conversation
…audio hashes (#719, #720) - #719: SpawnAsteroid's family/size roll mixed _config.Seed (launch flag, 0 in desktop singleplayer) instead of the persisted _meta.Seed - desktop worlds all shared the same per-field rock patterns, and relaunching a hosted world with a different/absent --seed silently re-rolled every asteroid. Regression test: reloading the same save under a different launch-config seed keeps the rocks. - #720: ProceduralAudio seeded its noise synthesis from name.GetHashCode() at 10 sites; string hashes are per-process randomised on .NET Core and differ across runtimes. Replaced with the codebase-standard stable order-dependent hash. Co-Authored-By: Claude Fable 5 <[email protected]>
marceld23
force-pushed
the
fix/seed-determinism
branch
from
August 4, 2026 16:57
f0ae22b to
cf4e501
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two seed-determinism fixes surfaced by a worldgen audit:
SpawnAsteroidmixed_config.Seed(the launch flag, 0 in desktop singleplayer) instead of the persisted_meta.Seed. Desktop worlds therefore all shared the same per-field rock family patterns, and relaunching a hosted world with a different/absent--seedsilently re-rolled every asteroid — contradicting the Varied mini-asteroids in space: seeded sizes and mineral families, including water ice #687 guarantee that the same world always grows the same rocks. Ordinal 0 stays pinned to the classic metallic rock.System.Randomwithname.GetHashCode(), which is per-process randomized on .NET Core and differs across runtimes/backends. Replaced with the codebase-standard order-dependent stable hash (same convention asNpcView/FloraTints).closes #719
closes #720
Test plan
SpaceAsteroids_RollSeededFamiliesAndSizes: reloading the same save under a different launch-config seed must yield identical rocks (fails on the old code).🤖 Generated with Claude Code